import http from '@/utils/request'

//题库列表

export const repositoryList = (prop) => {
  return http({
    url: `app/exam/repository/list?currentPage=${prop.currentPage}&pageSize=${prop.pageSize}`,
    method: "POST",
    data: {
      title: prop.title,
      id: prop.id,
      resourceIds: prop.resourceIds,
    },
  });
};
// 题库添加
export const repositorySave = (data) => {
  return http({
    url: `app/exam/repository/save`,
    method: "POST",
    data,
  });
};
//题库删除
export const repositoryDelete = ({ ids }) => {
  return http({
    url: `app/exam/repository/delete`,
    method: "POST",
    data: {
      ids,
    },
  });
};
//   题库详情
export const repositoryDetail = (data) => {
  return http({
    url: `app/exam/repository/detail`,
    method: "POST",
    data,
  });
};

// 试题列表
export const questionList = (prop) => {
  return http({
    url: `app/exam/question/list?currentPage=${prop.currentPage}&pageSize=${prop.pageSize}`,
    method: "POST",
    data: {
      repoId: prop.repoId,
      quType: prop.quType,
      content: prop.content,
      resourceIds: prop.resourceIds,
    },
  });
};
// 试题添加
export const questionSave = (data) => {
  return http({
    url: `app/exam/question/save`,
    method: "POST",
    data,
  });
};
//试题删除
export const questionDelete = ({ ids }) => {
  return http({
    url: `app/exam/question/delete`,
    method: "POST",
    data: {
      ids,
    },
  });
};
//   试题详情
export const questionDetail = (data) => {
  return http({
    url: `app/exam/question/detail`,
    method: "POST",
    data,
  });
};

// 考试列表
export const examList = (prop) => {
  return http({
    url: `app/exam/exam/list?currentPage=${prop.currentPage}&pageSize=${prop.pageSize}`,
    method: "POST",
    data: {
      resourceIds: prop.resourceIds,
      examType: prop.examType,
    },
  });
};
// 考试添加
export const examSave = (data) => {
  return http({
    url: `app/exam/exam/save`,
    method: "POST",
    data,
  });
};
//考试删除
export const examDelete = ({ ids }) => {
  return http({
    url: `app/exam/exam/delete`,
    method: "POST",
    data: {
      ids,
    },
  });
};
//   考试详情
export const examDetail = (data) => {
  return http({
    url: `app/exam/exam/detail`,
    method: "POST",
    data,
  });
};
export const examaMemberGetList = (data) => {
  return http({
    url: `app/exam/member/getList`,
    method: "POST",
    data,
  });
};
//   考试明细

export const examPaperGetList = (data) => {
  return http({
    url: `app/exam/paper/getList`,
    method: "POST",
    data,
  });
};
// 考试记录
export const exammembergetList = (data) => {
  return http({
    url: `app/exam/member/getList?currentPage=${data.currentPage}&pageSize=${data.pageSize}`,
    method: "POST",
    data: {
      id: data.id,
    },
  });
};

export const examaExprop = ({ examId }) => {
  return http({
    url: `app/exam/member/exportExcel`,
    method: "POST",
    data: {
      examId,
    },
    responseType: "blob",
  });
};

// 报警历史记录
export const warnList = (params) => {
  return http({
    url: `schedule/websocket/list`,
    method: "GET",
    params: {
      receiver: params.id,
    },
  });
};
// 不再提示
export const noWarn = (data) => {
  return http({
    url: `schedule/websocket`,
    method: "PUT",
    data
  });
};
// 发送短信
export const sendDeptSMS = (data) => {
  return http({
    url: `app/exam/exam/sendDeptSMS`,
    method: "post",
    data
  });
};



